using System;
using System.Collections.Generic;
using System.Text;

namespace Wrath.CodeBox
{
    public partial class CodeBox
    {
        private class Selection
        {

            public int Start = 1;
            public int Length = 0;
            public int StartLine = 0;
            public int EndLine = 0;

            public string Value
            {
                get
                {
                    return Start.ToString() + "|" + 
                        Length.ToString() + "|" + 
                        StartLine.ToString() + "|" + 
                        EndLine.ToString();
                }
                set
                {
                    string[] val = value.Split('|');

                    // check enough elements
                    if (val.Length != 4)
                    {
                        throw new Exception("Four entries required for String assignment");
                    }

                    // assign each
                    Start = Convert.ToInt32(val[0]);
                    Length = Convert.ToInt32(val[1]);
                    StartLine = Convert.ToInt32(val[2]);
                    EndLine = Convert.ToInt32(val[3]);
                }
            }
        }
    }
}
